<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('中学住宿生信息卡')" />
</head>
<style>
    .tdtextbold{
        font-weight: 600;
    }
    .widthh{
        width: 150px;
    }
    .width{
        width: 200px;
    }
    #studenttalkdetail{
        border: 1px solid #7e7e7e;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m">
        <div class="btn btn-success  dim" style="margin-bottom: 10px;" type="button" id="printbtn"><i class="fa fa-print"></i>&nbsp;打印此表</div><br>
        <table class="table table-bordered" id="dormitorystuinfo">
            <tbody>
            <tr>
                <td colspan="5" style="text-align: center;font-size: 20px;font-weight: bold;">中学住宿生信息卡</td>
            </tr>
            <tr>
                <td class="widthh">姓名</td>
                <td class="width" th:text="${dormitorystuinfo.stuName}"></td>
                <td style="text-align: center;" rowspan="8">
                    <img th:src="(${#strings.isEmpty(dormitorystuinfo.stuAvatar)}) ? @{/img/moren.jpg} : @{${dormitorystuinfo.stuAvatar}}"  width="180" height="260" />
                </td>
            </tr>
            <tr>
                <td class="widthh">宿舍</td>
                <td th:text="${dormitorystuinfo.dormitoryNum}"></td>
            </tr>
            <tr>
                <td class="widthh">床号</td>
                <td th:text="${dormitorystuinfo.stuBedno}"></td>
            </tr>
            <tr>
                <td class="widthh">年级</td>
                <td th:text="${dormitorystuinfo.stuGrade}"></td>
            </tr>
            <tr>
                <td class="widthh">班级</td>
                <td th:text="${dormitorystuinfo.stuClass}"></td>
            </tr>
            <tr>
                <td class="widthh">联系电话</td>
                <td th:text="${dormitorystuinfo.stuTell}"></td>
            </tr>
            <tr>
                <td class="widthh">入住时间</td>
                <td th:text="${#dates.format(dormitorystuinfo.inDate, 'yyyy-MM-dd')}"></td>
            </tr>
            <tr>
                <td class="widthh">备注</td>
                <td th:text="${dormitorystuinfo.remark}"></td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
<th:block th:include="include :: footer" />
<script src="../static/ruoyi/js/print.js" th:src="@{/ruoyi/js/print.js}"></script>
<script type="text/javascript">
    document.getElementById('printbtn').onclick = function () {
        Print('#dormitorystuinfo', {
            onStart: function () {
                console.log('onStart', new Date())
            },
            onEnd: function () {
                console.log('onEnd', new Date())
            },
            getStyle: function() {
                var str = "",
                    styles = document.querySelectorAll('style,link');
                console.log(styles);
                for (var i = 0; i < styles.length; i++) {
                    str += styles[i].outerHTML;
                }
                return str;
            }
        });
    }
        $(function () {
        });
</script>
</body>
</html>
